import request from "../request";
import {getToken} from "../../utils/auth";

export function selectBusinessByNameAndPage(businessName,pageNum,pageSize){
    if (businessName==null){
        businessName = ''
    }
    let url="/api/business/searchByNameAndPage";
    return request.get(url,{
        headers:{
            'Token':getToken()
        },
        params:{
            businessName,pageNum,pageSize
        }
    })
}

export function selectBusinessByIdIncludeUser(businessId){
    let url="/api/business/getByidIncludeUser";
    return request.get(url,{
        headers:{
            'Token':getToken()
        },
        params:{
            businessId
        }
    })
}

export function insertOrUpdateBusiness(business){
    let url="/api/business/save";
    return request.post(url,business,{
        headers:{
            'Token':getToken()
        },
    })
}